package com.viknix.threadpool.manager.http.request;

import com.viknix.threadpool.manager.http.Callback;
import com.viknix.threadpool.manager.http.handler.ResponseHandler;
import com.viknix.threadpool.manager.http.model.RequestHttpEntity;

import java.io.Closeable;
import java.net.URI;

/**
 * @Author: Dongqi
 * @Date: 2021/11/17 11:54
 * @Version 1.0
 * @Description: 表示客户端异步 HTTP 请求。
 */
public interface AsyncHttpClientRequest extends Closeable {
    
    
    /**
     * 执行异步http请求。
     *
     * @param uri               http url
     * @param httpMethod        http request method
     * @param requestHttpEntity http request entity
     * @param responseHandler   http response handler
     * @param callback          http response callback
     * @throws Exception ex
     */
    <T> void execute(URI uri, String httpMethod, RequestHttpEntity requestHttpEntity,
                     final ResponseHandler<T> responseHandler, final Callback<T> callback) throws Exception;
}
